package com.secret.core.util;

import com.secret.dao.dto.PictureDownloadDto;
import com.secret.dao.entity.UserControls;
import com.secret.dao.mapper.UserControlsMapper;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Component
public class TypeUtils {
    @Resource
    private PictureDownloadDto pictureDownloadDto;
    @Resource
    private UserControls userControls;
    @ApiModelProperty("对象转list")
    public  <T> List<T> objectToList(Object obj, Class<T> cla){
        List<T> list=new ArrayList<T>();
        if(obj instanceof ArrayList<?>){
            for (Object o: (List<?>) obj){
                list.add(cla.cast(o));
            }
            return list;
        }
        return null;
    }

}
